package cn.desk.faq.action;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.apache.struts2.osgi.interceptor.ServiceAware;

import cn.calm.commons.action.CurdAction;
import cn.calm.commons.entity.PageMode;
import cn.calm.entity.Faq;
import cn.desk.faq.service.IFaqService;
@SuppressWarnings({"rawtypes","unchecked"})
public class FaqAction<T extends Faq,S extends IFaqService<T>> extends CurdAction<T,S> implements ServiceAware<IFaqService>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public String getModeName() {
		return "faq";
	}

	@Override
	public PageMode getPageMode() {
		return super.getPageMode();
	}

	@Override
	public Collection<String> getActionErrors() {
		return super.getActionErrors();
	}

	@Override
	public Map<String, List<String>> getFieldErrors() {
		return super.getFieldErrors();
	}

	@Override
	public T getT() {
		return super.getT();
	}


	@Override
	public void setServices(List<IFaqService> services) {
		service=(S) services.get(0);
	}

	@Override
	public Class<T> getEntityClass() {
		return (Class<T>) Faq.class;
	}
}
